package demo.java.lang.management.vo;

public class XdcsConstants {

    /**
     * LogEntry category
     */
    public static final String TRACE = "trace";
    public static final String METRIC = "metric";
    public static final String EXCEPTION = "exception";
    public static final String SYSTEM = "system";
    public static final String LOG = "log";
    public static final String GCLOG = "gclog";

    public static final String X_ABTEST_BUCKETIDS = "x-abtest-bucketIds";

    public static final String X_B3_TRACE_ID = "X-B3-Trace-Id";
    public static final String X_B3_SPAN_ID = "X-B3-Span-Id";
    public static final String X_B3_CLIENT_APP_ID = "X-B3-clientApp-Id";
    public static final String X_B3_CLIENT_UID = "X-B3-client-Uid";
    public static final String X_B3_CLIENT_DID = "X-B3-client-Did";
    public static final String X_B3_CLIENT_UIP = "X-B3-client-Dip";
    public static final String X_B3_PARENT_ID = "X-B3-Parent-Id";
    public static final String X_B3_SERVICE_ID = "X-B3-Service-Id";
    public static final String X_B3_CALLER_SERVICE_ID = "X-B3-Caller_Service-Id";
    //测试的隔离字段，提供给mainstay3.0.15+使用
    public static final String MAINSTAY3015_ISOLATION = "isolation";
    //测试的探测字段
    public static final String XDCS_DETECT_REQUEST = "xdcs-detect-request";

    //peak压测字段
    public static final String PEAK_REQUEST = "peak-request";
    public static final String PEAK_FALL = "peak-fall";


    public static final String X_B3_CLIENT_IP = "X-B3-Client-Ip";
    public static final String X_B3_BACK_ID = "X-B3-Back-Id";
    public static final String X_B3_BACK_STEP_ID = "X-B3-Back-Step-Id";
    public static final String X_B3_FLAG = "X-B3-Flag";
    public static final String X_B3_SAMPLED = "X-B3-Sampled";
    public static final String X_D3_DETECT_APP = "X-D3-App";
    public static final String X_D3_DETECT_SERVICE = "X-D3-Service";
    public static final String X_D3_DETECT_HOST = "X-D3-Host";
    
    public static final String X_B2_SAMPLED = "X-B2-Sampled";
    
    public static final String X_B3_CALL_BACK = "X-B3-If-Call-Back";
    
    public static final String X_B3_RETURN_BACK = "X-B3-If-Return-Back";

    public static final String X_B3_SERVER_APP = "X-B3-Server-App";
    public static final String X_B3_SERVER_SERVICEID ="X-B3-Server-ServiceId";
    public static final String X_B3_SERVER_IP = "X-B3-Server-Ip";
    
    public static final String X_B3_SERVER_COSTTIME = "x-server-costtime";
    /**
     * Common constant
     */
    public static final String APP = "app";
    public static final String IP = "ip";
    public static final String DATE = "date";
    public static final String NAME = "name";
    public static final String STARTTIME = "startTime";
    public static final String ENDTIME = "endTime";

    public static final String LIMIT = "limit";

    /**
     * Time serious
     */
    public static final short MAX_TIMESPAN = 3600;

    /**
     * Exception constant
     */
    public static final String EXCEPTION_NAME = "Name";
    public static final String EXCEPTION_MESSAGE = "Message";
    public static final String EXCEPTION_STACK = "Stack";
    public static final String TRACE_ID = "TraceId";
    public static final String THREAD_INFO = "Thread";
    public static final String DEBUG = "Debug";

    /**
     * JVM metrics category
     */
    public static final String JVM = "jvm";
    public static final String JVM_CLASS = "jvm.class";
    public static final String JVM_MONITOR = "jvm.monitor";
    public static final String JVM_THREAD = "jvm.thread";
    public static final String JVM_MEMORY = "jvm.memory";
    public static final String JVM_GC = "jvm.gc";

    /**
     * Http metrics category
     */
    public static final String HTTPCLIENT = "httpclient.request.";
    public static final String HTTPCLIENT_AVAILABLE_CONN = "httpclient.connections.available.count";
    public static final String HTTPCLIENT_LEASED_CONN = "httpclient.connections.leased.count";
    public static final String HTTPCLIENT_MAX_CONN = "httpclient.connections.max.count";
    public static final String HTTPCLIENT_PENDING_CONN = "httpclient.connections.pending.count";
    public static final String HTTP_POST_STRING = "post";
    public static final String HTTP_GET_STRING = "get";
    public static final String HTTP_METHOD_ANNOTATION_KEY = "http.request.method";
    public static final String HTTP_REQUEST_URL_ANNOTATION_KEY = "http.request.url";
    public static final String HTTP_REQUEST_ORIGINAL_URL_ANNOTATION_KEY = "http.request.original.url";
    public static final String HTTP_REQUEST_PARAM_ANNOTATION_KEY = "http.request.param";
    public static final String HTTP_REQUEST_LOCAL_METHOD_ANNOTATION_KEY = "http.request.local.method";
    public static final String HTTP_RESPONSE_CODE_ANNOTATION_KEY = "http.response.code";
    public static final String HTTP_SERVER_EXCEPTION_RESULT_ANNOTATION_KEY = "http.server.exception.result";
    public static final String SERVER_RESULT_ANNOTATION_KEY = "server.result";
    public static final String CLIENT_RESULT_ANNOTATION_KEY = "client.result";

    /**错误日志手机操作系统版本 - app版本*/
    public static final String REQUEST_CLIENT_DEVICE_OS_VERSION = "request.device.os.version";
    public static final String REQUEST_CLIENT_DEVICE_NAME = "request.device.name";
    public static final String REQUEST_CLIENT_DEVICE_APP_VERSION = "request.device.app.version";

    public static final String CLIENT_IP_ANNOTATION_KEY = "client.ip";

    public static final String SERVER_IP_ANNOTATION_KEY = "server.ip";

    public static final String CLIENT_APP_ANNOTATION_KEY = "client.app";
    
    public static final String CLIENT_CALLER_SERVICE_KEY = "client.caller";
    
    public static final String SERVER_CALLEE_SERVICE_KEY = "server.callee";

    public static final String ANNOTATION_BLANK_DEFAULT_VALUE = "N/A";


    public static final String SERVER_RESULT_ANNOTATION_SUCCESS = "success";
    public static final String SERVER_RESULT_ANNOTATION_FAIL = "fail";

    /**
     * Thrift metrics category
     */
    public static final String THTTPCLIENT = "thriftclient.";

    /**
     * Servlet metrics category
     */
    public static final String SERVLET_CODE_OK = "servlet.response-code.200";
    public static final String SERVLET_CODE_CREATED = "servlet.response-code.201";
    public static final String SERVLET_CODE_NO_CONTENT = "servlet.response-code.204";
    public static final String SERVLET_CODE_BAD_REQUEST = "servlet.response-code.400";
    public static final String SERVLET_CODE_NOT_FOUND = "servlet.response-code.404";
    public static final String SERVLET_CODE_SERVER_ERROR = "servlet.response-code.500";
    public static final String SERVLET_CODE_OTHER = "servlet.response-code.other";

    public static final String SERVLET_ACTIVE_REQUEST = "servlet.request.active-request.count";
    public static final String SERVLET_REQUEST = "servlet.request.all";

    public static final int OK = 200;
    public static final int CREATED = 201;
    public static final int NO_CONTENT = 204;
    public static final int BAD_REQUEST = 400;
    public static final int NOT_FOUND = 404;
    public static final int SERVER_ERROR = 500;

    /**
     * Cache metrics category
     */
    public static final String Cache = "cache.";

    /**
     * DB
     */
    public static final String DB = "db.";
    public static final String DB_EXECUTE_SQL_ANNOTATION_KEY = "db.execute.sql";
    public static final String DB_JDBC_URL_ANNOTATION_KEY = "db.jdbc.url";
    public static final String DB_EXECUTE_RESULT_ANNOTATION_KEY = "db.execute.result";

    public static final String DB_URL = "db_url";
    public static final String DB_SQL = "db_sql";
    
    /**
     * rabbitmq
     */
    public static final String RABBIT = "rabbit.";
    public static final String RABBIT_HOST_ANNOTATION_KEY = "rabbit.host";
    public static final String RABBIT_PORT_ANNOTATION_KEY = "rabbit.port";
    public static final String RABBIT_EXECUTE_RESUL_ANNOTATION_KEY = "rabbit.result";
    
    /**
     * redis
     */
    public static final String REDIS = "redis.";
    public static final String REDISE_HOST_ANNOTATION_KEY = "redis.host";
    public static final String REDISE_PORT_ANNOTATION_KEY = "redis.port";
    public static final String REDISE_OPER_ANNOTATION_KEY = "redis.oper";
    public static final String REDISE_PARAM_ANNOTATION_KEY = "redis.param";
    public static final String REDISE_EXECUTE_RESUL_ANNOTATION_KEY = "redis.result";

    public static final String REDISE_HOST = "redis_host";
    public static final String REDISE_PORT = "redis_port";
    public static final String REDISE_TIMEOUT = "redis_timeout";
    
    /**
     * method
     */
    public static final String METHOD = "method.";
    public static final String METHOD_CLASS_NAME_ANNOTATION_KEY = "method.class.name";
    public static final String METHOD_NAME_ANNOTATION_KEY = "method.name";
    public static final String METHOD_PARAM_ANNOTATION_KEY = "method.param";
    public static final String METHOD_EXECUTE_RESULT_ANNOTATION_KEY = "method.result";
    public static final String METHOD_EXECUTE_ISSUCCESS_ANNOTATION_KEY = "method.isSuccess";
    
    
    /**
     * thrift
     */
    public static final String THRIFT = "thrift.";
    public static final String THRIFT_SERVICE_ANNOTATION_KEY = "thrift.service";
    public static final String THRIFT_HOST_ANNOTATION_KEY = "thrift.host";
    public static final String THRIFT_SERVER_URL_KEY = "thrift.serverUrl";
    public static final String THRIFT_PORT_ANNOTATION_KEY = "thrift.port";
    public static final String THRIFT_OPER_ANNOTATION_KEY = "thrift.oper";
    public static final String THRIFT_PARAM_ANNOTATION_KEY = "thrift.param";
    public static final String THRIFT_EXECUTE_RESUL_ANNOTATION_KEY = "thrift.result";
    
    /***
     * STAT
     * METRIC NAME
     */
    public static final String STAT_EXCEPTION_COUNT = "exception_count";
    public static final String STAT_RPC_COUNT = "rpc_count";
    public static final String STAT_RPC_RESPONSE_TIME = "rpc_response_time";
    public static final String STAT_RPC_RESPONSE_TIME_AVG = "rpc_response_time_avg";
    public static final String STAT_RPC_RESPONSE_TIME_75 = "rpc_response_time_75";
    public static final String STAT_RPC_RESPONSE_TIME_85 = "rpc_response_time_85";
    public static final String STAT_RPC_RESPONSE_TIME_95 = "rpc_response_time_95";


    public static final String STAT_RPC_RESPONSE_TIME_APP_TARGET = "rpc_response_time_app_target";
    public static final String STAT_RPC_RESPONSE_TIME_APP_TARGET_API = "rpc_response_time_app_target_api";
    public static final String STAT_RPC_RESPONSE_TIME_APP_NAME_TARGET = "rpc_response_time_app_name_target";
    public static final String STAT_RPC_RESPONSE_TIME_APP_NAME_TARGET_API = "rpc_response_time_app_name_target_api";
    public static final String STAT_SERVER_COUNT = "svr_count";
    public static final String STAT_SERVER_RESPONSE_TIME = "svr_response_time";
    public static final String STAT_SERVER_RESPONSE_TIME_AVG = "svr_response_time_avg";
    public static final String STAT_SERVER_RESPONSE_TIME_75 = "svr_response_time_75";
    public static final String STAT_SERVER_RESPONSE_TIME_85 = "svr_response_time_85";
    public static final String STAT_SERVER_RESPONSE_TIME_95 = "svr_response_time_95";
    public static final String STAT_SERVER_RESPONSE_TIME_APP = "svr_response_time_app";
    public static final String STAT_SERVER_RESPONSE_TIME_APP_NAME = "svr_response_time_app_name";
    public static final String STAT_SERVER_RESPONSE_TIME_APP_HOST = "svr_response_time_app_host";
    public static final String STAT_SERVER_RESPONSE_TIME_APP_HOST_NAME = "svr_response_time_host_name";
    
    public static final String STAT_SERVER_RESPONSE_TIME_APP_CALLER_APP = "svr_response_time_app_caller_app";
    public static final String STAT_SERVER_RESPONSE_TIME_APP_NAME_CALLER_APP = "svr_response_time_app_name_caller_app";
    
    
    public static final String STAT_DB_RESPONSE_TIME = "db_response_time";
    public static final String STAT_DB_RESPONSE_TIME_AVG = "db_response_time_avg";
    public static final String STAT_DB_RESPONSE_TIME_75 = "db_response_time_75";
    public static final String STAT_DB_RESPONSE_TIME_85 = "db_response_time_85";
    public static final String STAT_DB_RESPONSE_TIME_95 = "db_response_time_95";
    public static final String STAT_CACHE_RESPONSE_TIME = "cache_response_time";
    public static final String STAT_CACHE_RESPONSE_TIME_AVG = "cache_response_time_avg";
    public static final String STAT_CACHE_RESPONSE_TIME_75 = "cache_response_time_75";
    public static final String STAT_CACHE_RESPONSE_TIME_85 = "cache_response_time_85";
    public static final String STAT_CACHE_RESPONSE_TIME_95 = "cache_response_time_95";

    public static final String STAT_SLOW_CALL_COUNT = "slow_call_count";
    public static final String STAT_VERY_SLOW_CALL_COUNT = "very_slow_call_count";

    /***
     *
     * TAG
     */

    //server
    public static final String TAG_TARGET_APP = "target_app";
    public static final String TAG_TARGET_HOST = "target_host";
    public static final String TAG_TARGET_API = "api";

    //client
    public static final String TAG_APP = "app";
    public static final String TAG_CLIENT_SERVICE = "name";
    public static final String TAG_HOST = "host";
    public static final String TAG_IP = "ip";

    public static final String TAG_APP_NAME = "app_name";

    public static final String TAG_DB_HOST = "db_host";
    public static final String TAG_DB_NAME = "db_name";
    public static final String TAG_CACHE_HOST = "cache_host";
    public static final String TAG_CACHE_OPER_TYPE = "oper_type";
    
    public static final String TAG_LOG_TYPE = "log_type";
    public static final String TAG_LOG_LEVEL = "level";
    public static final String TAG_LOG_MESSAGE = "message";
    public static final String LOG_ERROR_LEVEL_VALUE = "ERROR";
    public static final String LOG_WARN_LEVEL_VALUE = "WARN";
    public static final String LOG_FATAL_LEVEL_VALUE = "FATAL";
    public static final String LOG_INFO_LEVEL_VALUE = "INFO";
    public static final String LOG_DEBUG_LEVEL_VALUE = "DEBUG";
    
    public static final String TAG_RESULT_CODE = "result_code";
    public static final String TAG_RESULT_CODE_VALUE_ERROR = "fail";
    public static final String TAG_RESULT_CODE_VALUE_SUCCESS = "success";
    
    public static final String TAG_RESPONSE_CODE = "response_code";
    //and 数字

    public static final String TAG_RESULT_SPEED = "result_speed";
    public static final String TAG_RESULT_SPEED_VALUE_SLOW = "slow";
    public static final String TAG_RESULT_SPEED_VALUE_VERY_SLOW = "very_slow";
    public static final String TAG_RESULT_SPEED_VALUE_NOMAL = "normal";

    public static final String TAG_RESPONSE_PERCENT = "response_percent";
    public static final String TAG_RESPONSE_PERCENT_AVG = "avg";
    public static final String TAG_RESPONSE_PERCENT_75 = "75";
    public static final String TAG_RESPONSE_PERCENT_85 = "85";
    public static final String TAG_RESPONSE_PERCENT_95 = "95";
    public static final String TAG_RESPONSE_MAX="max";
    public static final String TAG_RESPONSE_MIN="min";

    public static final String STAT_SAMPLE_TRACE = "sample_trace";//此metric存对trace的采样
    public static final String STAT_SAMPLE_LOG_TRACE = "sample_log_trace";//此metric存对log的采样
    public static final String TAG_SAMPLE_TRACE_ID="sample_trace_id";
    public static final String TAG_SAMPLE_TRACE_ID_1_VALUE="sample_trace_id_1";
    public static final String TAG_SAMPLE_TRACE_ID_2_VALUE="sample_trace_id_2";
    public static final String TAG_SAMPLE_TRACE_ID_3_VALUE="sample_trace_id_3";

    public static final String STAT_SAMPLE_RESPONSE_TIME = "sample_response_time";//对应采样的最大最小时间
    public static final String TAG_SAMPLE_RESPONSE_TIME_MAX_MIN="sample_response_time_max_min";
    /***
     *
     * alert,alert_tag
     */
    public static final String ALERT_COUNT = "alert_count";
    public static final String TAG_ALERT_TYPE = "alert_type";
    public static final String TAG_ALERT_ERROR_RATE_VALUE = "alert_error_rate";
    public static final String TAG_ALERT_SLOW_RATE_VALUE = "alert_slow_rate";
    public static final String TAG_ALERT_EXCEPTION_COUNT_VALUE = "alert_exception_count";
    public static final String TAG_ALERT_FATAL_ERROR_VALUE = "alert_fatal_count";
    public static final String TAG_ALERT_RPC_CALL_ERROR_RATE_VALUE = "alert_rpc_call_error_rate";
    public static final String TAG_ALERT_SERVER_LOAD_RATE_VALUE = "alert_server_load_rate";
    public static final String TAG_ALERT_RESPONSE_TIME_RATE_VALUE = "alert_response_time_rate";
    public static final String TAG_ALERT_LEVEL = "alert_level";
    public static final String TAG_ALERT_LEVEL_VALUE_MAJOR = "major";
    public static final String TAG_ALERT_LEVEL_VALUE_CRITICAL = "critical";
    public static final String TAG_ALERT_MAINSTAY_POOL="alert_mainstay_pool";
    public static final String TAG_ALERT_MAINSTAY_SERVER_THREAD="alert_mainstay_server_thread";
    public static final String TAG_ALERT_TOMCAT_METRIC="alert_tomcat_metric";

    public static final String WEB_HEALTH_CHECK_URL = "/_health_check";

    /**
     * ConfigParamDO's status
     */
    public static final String CONFIG_STATUS_ENABLE = "enable";
    public static final String CONFIG_STATUS_DISABLE = "disable";

    public static final String ALERT_RULE_THRESHOLD_KEY = "#threshold#";
    public static final String ALERT_RULE_THRESHOLD_KEY_1 = "#threshold1#";
    public static final String ALERT_RULE_THRESHOLD_KEY_2 = "#threshold2#";


    /**
     * jvm monitor
     */
    public static final String JVM_CLASSLOAD_METRIC = "jvm_classload";
    public static final String LOADEDCLASS_COUNT_KEY = "loadedClassCount";
    public static final String TOTAL_LOADEDCLASS_COUNT_KEY = "totalLoadedClassCount";
    public static final String UNLOADED_CLASS_COUNT_KEY = "unloadedClassCount";
    public static final String TOTAL_COMPILATION_TIME_KEY ="totalCompilationTime";

    public static final String JVM_GC_METRIC = "jvm_gc";
    public static final String JVM_FGC_METRIC = "jvm_fgc";
    public static final String GC_NAME_KEY = "gc_name";
    public static final String COLLECTION_COUNT_KEY = "collectionCount";
    public static final String GC_DURATION_KEY = "gcDuration";
    public static final String COLLECTION_TIME_KEY = "collectionTime";

    public static final String JVM_HEAP_METRIC = "jvm_heap";
    public static final String MEMORYPOOL_NAME_KEY = "memoryPool_name";
    public static final String USED_KEY = "used";
    public static final String PEAK_USED_KEY = "peakUsed";
    public static final String MAX_KEY = "max";
    public static final String INIT_KEY = "init";
    public static final String COMMITTED_KEY = "committed";

    public static final String BANDWIDTH_OUT_DEFAULT_METRIC = "bandwidth_out";
    public static final String QPS_DEFAULT_METRIC = "api_qps";
    public static final String NETTY_DEFAULT_METRIC = "channel_pool";
    public static final String NETTY_SERVER_CONNECTOR_METRIC = "netty_server_connector";
    public static final String API_TP90_METRIC = "api_tp90";
    public static final String NETTY_SERVER_THREAD_POOL = "netty_server_thread_pool";

    public static final String ALBUM_PLAY_FDS_METRIC = "album_play_fds";
    public static final String TAG_ALBUM_ID = "album_id";
    public static final String PAY_PLAY_COUNT_FDS_METRIC = "pay_play_count_fds";
    public static final String PAY_PLAY_SHARE_ACOUNT_FDS_METRIC = "pay_play_share_account_fds";
    public static final String TAG_FDS_UID = "uid";
    public static final String TAG_FDS_TYPE = "type";

    public static final String ACQUIRED_CHANNEL_COUNT_KEY = "acquiredChannelCount";
    public static final String PENDING_QCQUIRE_COUNT_KEY = "pendingAcquireCount";
    public static final String API_QPS_KEY = "apiOneMinQuery";
    public static final String TAG_API_NAME = "api_name";

    public static final String SESSION_COUNT_KEY = "acquiredChannelCount";
    public static final String WORKTHREAD_ACTIVE_COUNT_KEY = "workThreadActiveCount";
    public static final String WORKTHREAD_POOLSIZE_KEY = "workThreadPoolSize";
    public static final String WORKTHREAD_QUEUESIZE_KEY = "workThreadQueueSize";

    public static final String JVM_CPU_METRIC = "jvm_cpu";
    public static final String JVM_THREAD_METRIC = "jvm_thread";
    public static final String CPU_RATE_KEY = "cpuRate";
    public static final String SYSTEM_LOADAVERAGE_KEY = "systemLoadAverage";
    public static final String DAEMON_THREAD_COUNT_KEY = "daemonThreadCount";
    public static final String PEAK_THREAD_COUNT_KEY = "peakThreadCount";
    public static final String THREAD_COUNT_KEY = "threadCount";
    public static final String TIMEDWAITING_THREAD_COUNT_KEY = "timedWaitingThreadCount";
    public static final String WAITING_THREAD_COUNT_KEY = "waitingThreadCount";
    public static final String RUNNABLE_THREAD_COUNT_KEY = "runnableThreadCount";

    public static final String FIRSTKADUN_NUM = "num";
    public static final String FIRSTKADUN_BLOCKLAST = "blockLast";
    public static final String FIRSTKADUN_BLOCKTIMES = "blockTimes";
    public static final String FIRSTKADUN_PLAYDURATION = "playDuration";
    public static final String FIRSTKADUN_BLOCKUNIT = "blockunit";
    public static final String FIRSTKADUN_BLOCKTIMEUNIT = "blockTimeunit";




    public static final String JVM_DATA_TYPE_KEY = "data_type";

    public static final String DATA_TYPE_KEY = "data_type";


    /**
     * playkadun 播放卡顿
     * 
     * 
     */
    public static final String TAG_PROVINCE = "province";
	public static final String TAG_BLOCKDOMAIN = "blockDomain";
	public static final String TAG_PLAYTYPE="playType";
	public static final String TAG_DATATYPE="dataType";
	public static final String KADUNMETRIC="block_first";


    public static final String RESPONSE_TIME_AVG = "-AVG";
    public static final String RESPONSE_TIME_MIN = "-MIN";
    public static final String RESPONSE_TIME_MAX = "-MAX";

    /**
     * mainstay3和xdcs定义的调用参数
     *
     */
    public static final String X_M_RPC_ARGS_PREFIX = "x_m_rpc_args_";
    /**
     * 响应时间查询维度
     */
    public static final String QUERY_LEVEL_APP="app";
    public static final String QUERY_LEVEL_APP_API="app_api";
    public static final String QUERY_LEVEL_APP_API_HOST="app_api_host";




}
